package com.caimiao.miao.page.master.system.bluetooth;

import android.app.Activity;
import android.content.Context;
import android.widget.ListAdapter;

import com.caimiao.miao.interfaces.IBaseModel;
import com.caimiao.miao.interfaces.IBasePresenter;
import com.caimiao.miao.interfaces.IBaseActView;
import com.caimiao.miao.library.bluetooth.BTDevice;

import java.util.List;

import io.reactivex.Observable;

public interface IBluetoothContact {
    interface View extends IBaseActView<Presenter> {
        void setAdapter(ListAdapter adapter);

        void setRead(String value);

        String getWrite();
    }

    interface Presenter extends IBasePresenter {
        void startDiscovery(Activity activity);

        void findBluetoothDevice(Context context);

        void connect(BTDevice device);

        void send(String value);
    }

    interface Model extends IBaseModel {
        boolean initBluetooth(Context context);

        void startDiscovery();

        List<BTDevice> getBondedDevices();

        void unregisterBluetoothReceiver();

        void connect(BTDevice device);

        Observable<BTDevice> getDevices();

        Observable<String> read();

        void write(byte[] value);
    }
}
